
/*--------------------进入界面--------------------*/
function Width(){
	var top=document.getElementById("top");
	var content=document.getElementById("content");
	var contentRight=document.getElementById("content_right");
	var width=window.screen.width;
	/*var a=top.style.width;*/
	top.style.width=width+"px";
	content.style.width=width-3+"px";
	
	var x=(width-1000-200)/2;
	contentRight.style.right=x+"px";	
}

/*--------------------鼠标点击右边栏目--------------------*/
function Onclick(t,pane,panke){
	var t=document.getElementById(t);
	var panek=document.getElementById(panke);
	/*var block=document.getElementsByClassName("block");*/
	var width=window.screen.width;
	var content=document.getElementById("content");
	
	var x=(width-1000-200)/2;
	panek.style.right=x+"px";
	
	$("div").siblings(".block").removeClass("block").addClass("none");
	$(pane).removeClass("none");
	$(pane).addClass("block");

}

function Over(t){
	var t=document.getElementById(t);
	t.style.color="#FF6765";
}

function Out(t){
	var t=document.getElementById(t);
	t.style.color="#333333";	
}
/*--------------------班主任信息管理--------------------*/
function divBoxed(text1){
	var text1=document.getElementById(text1);
	text1.value=("");
}
function divBox(text1,STring){
	var text1=document.getElementById(text1);
	if(text1.value=="")
	{
			text1.value=STring;
	}
}
/*--------------------更改添加按钮--------------------*/
function changeButtom(buttomed,change_buttom){
	var buttomed=document.getElementById(buttomed);
	var change_buttom=document.getElementById(change_buttom);
	
	buttomed.style.display="none";
	change_buttom.style.display="block";
}
function changeButtomUp(buttomed,change_buttom){
	var buttomed=document.getElementById(buttomed);
	var change_buttom=document.getElementById(change_buttom);
	
	buttomed.style.display="block";
	change_buttom.style.display="none";
}
/*--------------------浏览文件框--------------------*/
function fileValue(){
	var text1=document.getElementById("text1");
	var File=document.getElementById("file").files;
    var File1=document.getElementById("file");
    var browser=navigator.appName ;
    var b_version=navigator.appVersion;
    var version=b_version.split(";");
   /* var trim_Version=version[1].replace(/[ ]/g,"");*/
    var name="";
    var f="\\";

    /*if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE8.0") */
   if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE8.0") 
    {
    	text1.value=File1.value;
    }
    else
	{text1.value=File[0].name;}
}

function fileValue1(){
	var text1=document.getElementById("text2");
	var File=document.getElementById("file1").files;
    var File1=document.getElementById("file1");
    var browser=navigator.appName ;
    var b_version=navigator.appVersion;
    var version=b_version.split(";");
   /* var trim_Version=version[1].replace(/[ ]/g,"");*/
    var name="";
    var f="\\";

    /*if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE8.0") */
   if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE8.0") 
    {
    	text2.value=File1.value;
    }
    else
	{text2.value=File[0].name;}
}
/*--------------------弹窗--------------------*/
function smallWindow3(ui){
	var width=window.screen.width;
	var height=window.screen.height-97;
	var smallwindow=document.getElementById("small_window");
	var big=document.getElementById("big");
	var jk=document.getElementById("jk");
	
	jk.innerHTML=ui;
	
	var big=document.getElementById("big");
	big.style.display="block";
	big.style.height=height+"px";
	big.style.width=width+"px";
	

	
	/*$("#page").addClass("body_background");*/
	$(".top").addClass("stationery_opacity");
	$(".content").addClass("stationery_opacity");
	
	var x=width/2-402/2;
	var y=height/2-302/2;

	smallwindow.style.top=y+"px";
	smallwindow.style.left=x+"px";
	smallwindow.style.display="block";
	smallwindow.style.zIndex="500";
	
}
function cancel_onclick(){
	var smallwindow=document.getElementById("small_window");
	var big=document.getElementById("big");
	big.style.display="none";
	var first=document.getElementById("content_right_3_bottom");
	var second=document.getElementById("content_right_3_bottomed");
	
	var five=document.getElementById("content_right_1_buttom1");
	var forth=document.getElementById("content_right_1_buttomed");
	
	var six=document.getElementById("content_right_4_forthed");
	var seven=document.getElementById("content_right_4_forth");
	
	var eight=document.getElementById("content_right_1_bottomBottomed");
	var nine=document.getElementById("content_right_1_bottomBottom");
	var text1=document.getElementById("text1");
	
	var ten=document.getElementById("content_right_2bottomed");
	var ele=document.getElementById("content_right_2bottom");
	var text2=document.getElementById("text2");
	
	ten.style.display="block";
	ele.style.display="none";
	text2.value="";
	
	eight.style.display="block";
	nine.style.display="none";
	text1.value="";
	
	six.style.display="block";
	seven.style.display="none";
	
	forth.style.display="block";
	five.style.display="none";
	
	first.style.display="none";
	second.style.display="block";
	
	/*$("#page").removeClass("body_background");*/
	$(".top").removeClass("stationery_opacity");
	$(".content").removeClass("stationery_opacity");
	
	smallwindow.style.display="none";
	smallwindow.style.zIndex="-200";
	
}
/*-------------------------enter-----------------------*/
function keyhi(){
  if (event.keyCode==13)  
  document.getElementById("cluded").click();
}
/*-------------------------手机号码和教工号码的判断-----------------------*/
function checksmallPane(){
	var PhoneNum=document.getElementById("phoneNum");
	var Num=document.getElementById("num");
	
	var NumLen=Num.value.length;
	var phoneLen=PhoneNum.value.length;
	
	if(phoneLen<11||PhoneNum.value=="手机号码")
	{
		alert("请输入正确的手机号码！");
		return false;
	}
	else{
		for(var i=0;i<phoneLen;i++)
		{
			var c=PhoneNum.value.charAt(i);
			if(c<"0"||c>"9")
			{
				alert("请输入正确的手机号码！");
				return false;
			}
			}
		}
	
	if(NumLen<7||Num.value=="教工号码")
	{
		alert("请输入正确的教工号！");
		return false;
	}
	else
	{
		for(var k=0;k<NumLen;k++)
		{
			var t=Num.value.charAt(k);
			if(t<"0"||t>"9")
			{
				alert("请输入正确的教工号！");
				return false;
			}
		}
	}
	
	changeButtom('content_right_1_buttomed','content_right_1_buttom1');
	smallWindow3('添加成功');
}